<?php

namespace app\common\request;
use think\Log;
/**
 * 
 */
class Command 
{
	
	public static function response($data,$url){
        $headers[] = 'Sign:'.'C1A21A67C70CBC66F9FC3BF5B1F64D43';
        $curl = new Curl; 
        $res = $curl->set('CURLOPT_HTTPHEADER',$headers)->post(http_build_query($data))->url($url);

		if($curl->error()){

            Log::record($curl->message(),'error');          
            $content = [];
                
        }else{

            $info = $curl->info();
            
            if($info['http_code'] == 200){

                $content = $curl->data();

            }else{
               
                Log::record('对方服务器错误','error');
                $content = [];
            }
        }

        return $content;
	}
}